<template>
 <view>
  <u-mask :show="isYhPopup">
   <view class="activityPopup">
    <view class="rect" @tap.stop>
     <!-- <image src="http://zxylblindbox.oss-cn-beijing.aliyuncs.com/uploads/20220915/f813686152f062865f920c256de1f159.png" @click="navActivityDetails('/pages/index/signin')"></image> -->
    <image :src="data.zpimg" @click="navActivityDetails('/pages/index/signin')"></image>
     <view class="close" @click="closeActivityPopup()">
      <image src="/static/images/close.png" class="closeicon"></image>
     </view>
    </view>
   </view>
  </u-mask>
 </view>
</template>

<script>
 export default {
  name:"yhPopup",
  props:{
   isYhPopup:{
    type:Boolean,
    default:false
   },
   data:{
    type:Object,
    default(){
     return {}
    }
   }
  },
  methods:{
   //跳转活动详情
   navActivityDetails(url){
    if(!uni.getStorageSync('token')){
     uni.showModal({
      title: '温馨提示',
      content: '登录后可继续操作，是否登录？',
      success: (res) => {
       if (res.confirm) {
        uni.navigateTo({
         url: '/pages/login/login'
        })
       }
      }
     })
    }else{
     uni.navigateTo({
      url
     })
     this.$emit('closeYhPopup');
    }
   },
   //关闭活动弹窗
   closeActivityPopup(){
    this.$emit('closeYhPopup');
   }
  }
 }
</script>

<style lang="scss" scoped>
.activityPopup {
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 height: 100%;
 
 .rect {
  width: 100%;
  @include column-center;
  
  image{
   width: 510rpx;
   height: 560rpx;
   border-radius: 20rpx;
  }
  .close{
   margin-top: 46rpx;
  
   .closeicon{
    width: 52rpx;
    height: 50rpx;
   }
  }
 }
}
</style>